<style>
<!--
td
{
text-align:center;
}
-->
</style>
<form name='adminForm' action='index.php?option=com_svquanlycanbo&view=bangluong' method='post'>
	<input type='hidden' name='task' />
	<input type="hidden" name="boxchecked" value="0" />
	<div id="editcell">
	<table>
		<tbody><tr>
			<td align="left" width="100%">
			                 <?php 
			                 // danh de phan trang ,vi du 2 ban ghi tren mot trang
			                 $records=5;
			                 $count=$this->count;
			                 $numbersPage=ceil($count/$records); // so luong trang
			                 $page= $this->page; // trang hien tai, default =1
			                 if($page==0) $page=1;
			                 // lay du lieu ve theo tung trang 
			                 echo 'Số lượng : '.$count.' records. <br/>';
			                 // hien thi so trang
			                  echo 'Page  ';
			                  $iddonviquanly=$this->iddonviquanly;
			                  $idphongban=$this->idphongban;
			                  $idcanbo=$this->idcanbo;
                             for($i=1;$i<=$numbersPage;$i++)
                             {
	                         echo ($i==$page) ? '<b style="font-size:17px;"><a href="index.php?option=com_svquanlycanbo&view=bangluong&page='.$i.'&iddonviquanly='.$iddonviquanly.'&idphongban='.$idphongban.'&idcanbo='.$idcanbo.'"> '.$i.'</a></b>
	                         ' : '<b style="font-size:13px;"><a href="index.php?option=com_svquanlycanbo&view=bangluong&page='.$i.'&iddonviquanly='.$iddonviquanly.'&idphongban='.$idphongban.'&idcanbo='.$idcanbo.'"> '.$i.'</a></b>';
                             }
                             ?>  
			</td>
			<td nowrap="nowrap">
			   <select name="iddonviquanly" id=iddonviquanly class="inputbox" size="1" onchange="document.adminForm.submit();">
                            <option value="0" >- chọn đơn vị -</option>
                            <?php 
                            //document.adminForm.submit();
                            foreach($this->donviList as $record)
                            {
	                        echo ($record->dvql_id==$iddonviquanly) ? '<option value="'.$record->dvql_id.'" selected="selected">
	                        '.$record->dvql_ten.'</option>' : '<option value="'.$record->dvql_id.'">'.$record->dvql_ten.'</option>';
                            }
                            ?>  
                             <option value="0">Tất cả</option>                                                                                 
				</select>	
				<select name="idphongban" id="idphongban" class="inputbox" size="1" onchange="document.adminForm.submit();">
                            <option value="0" >- chọn phòng ban -</option>
                            <?php 
                            //document.adminForm.submit();
                            foreach($this->phongbanList as $record)
                            {
	                        echo ($record->pb_id==$idphongban) ? '<option value="'.$record->pb_id.'" selected="selected">
	                        '.$record->pb_ten.'</option>' : '<option value="'.$record->pb_id.'">'.$record->pb_ten.'</option>';
                            }
                            ?>  
                             <option value="0">Tất cả</option>                                                                                 
				</select>	
				<select name="idcanbo" id="idcanbo" class="inputbox" size="1" onchange="document.adminForm.submit();">
                            <option value="0" >- chọn cán bộ -</option>
                            <?php 
                            //document.adminForm.submit();
                            foreach($this->canboList as $record)
                            {
	                        echo ($record->cb_id==$idcanbo) ? '<option value="'.$record->cb_id.'" selected="selected">
	                        '.$record->cb_ten.'</option>' : '<option value="'.$record->cb_id.'">'.$record->cb_ten.'</option>';
                            }
                            ?>  
                             <option value="0">Tất cả</option>                                                                                 
				</select>
				</td>
		</tr>
		</tbody>
</table>
		<table class='adminlist'>
			<thead>
				<tr>
					<th width="20">#</th>
					<th width="20"><input type="checkbox" name="toggle" value="" onclick="checkAll(10);"></th>
					<th width="100">Tên cán bộ</th>
					<th width="100">Chức vụ</th>
					<th width="100">Phòng ban</th>
					<th width="120">Bậc lương</th>
					<th width="120">Tên nghạch</th>
					<th width="100">Loại</th>
					<th width="100">Ngày tạo</th>
					<th width="50">ID</th>
				</tr>
			</thead>
			<tbody>
				<?php 
					$i=0;
					$k=0;
					foreach($this->dataObject as $record)
					{
						$checked     = JHTML::_('grid.id',   $k , $record->bl_id);
						$k=$k+1;
						echo '<tr class="row'.$i.'">';
							echo '<td width="50">'.$k.'</td>';
							echo '<td width="50">'.$checked.'</td>';
							echo '<td width="100">'.$record->cb_ten.'</td>';
							echo '<td width="100">'.$record->cv_ten.'</td>';
							echo '<td width="100">'.$record->pb_ten.'</td>';
							echo '<td width="120">'.$record->bl_bacluong.'</td>';
							echo '<td width="120">'.$record->bl_tennghach.'</td>';
							echo '<td width="100">'.$record->bl_loainghach.'</td>';
							echo '<td width="100">'.$record->bl_ngaytao.'</td>';
							echo '<td width="50">'.$record->sn_id.'</td>';
						echo '</tr>';
						$i=1-$i;	
					}

				?>
			</tbody>
		</table>
	</div>
</form>